var t = !1,
    a = !1;
Page({
    data: {
        imgUrls: [
            'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg',
            'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg',
            'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'
        ],
        navbarArray: [],
        navbarShowIndexArray: 0,
        navigation: !1,
        indicatorDots: true, //	是否显示面板指示点
        autoplay: false, //是否自动切换
        interval: 5000, //	自动切换时间间隔
        duration: 700, //滑动动画时长
        page: 1,
        list: []
    },
    // 打开网页
    openWebView: function(e) {
        let weburl = e.currentTarget.dataset.weburl;
        wx.navigateTo({
            //url: '/pages/web/web?url=' + weburl
            url:weburl
        })
    },
    onLoad: function(t) {
        getApp().page.onLoad(this, t), this.loadData(t);
    },
    loadData: function(t) {
        var a = this;
        a.reloadList();
    },
    reloadList: function() {
        var t = this;
        a = !1, t.setData({
            page: 1,
            list: []
        });
        var i = t.data.page || 1;
        getApp().request({
            url: getApp().api.default.dynamic_list,
            data: {
                page: i
            },
            success: function(e) {
                console.log(e);
                0 == e.code && (0 == e.data.list.length && (a = !0), t.setData({
                    page: i + 1
                }), t.setData({
                    list: e.data.list
                }));
                wx.stopPullDownRefresh();
            },
            complete: function() {}
        });
    },
    // 下拉刷新
    onPullDownRefresh: function() {
        this.setData({
            page: 1,
        });
        this.reloadList();
    },
    // 到达底部加载更多
    onReachBottom: function() {
        if (this.data.last_page >= this.data.page) {
            this.reloadList();
        }
    },
    // 图片预览
    imgYu: function(event) {
        var src = event.currentTarget.dataset.src; //获取data-src
        var imgList = event.currentTarget.dataset.list; //获取data-list
        wx.previewImage({
            current: src, // 当前显示图片的http链接
            urls: imgList // 需要预览的图片http链接列表
        })
    },
})